<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<style>
.prog-border {
	height: 15px;
	width: 205px;
	background: #fff;
	border: 1px solid #000;
	margin: 0;
	padding: 0;
}

.prog-bar {
	height: 11px;
	margin: 2px;
	padding: 0px;
	background: #178399;
	font-size: 10pt;
}

body {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 10pt;
}
</style>

	<script src="prototype.js" language="JavaScript" type="text/javascript"></script>
	<script type="text/javascript" language="JavaScript">
  var updater = null;

  function startStatusCheck(){
    //设置上传按钮为不可用状态，避免多次提交
    $('submitButton').disabled = true;
    //创建周期性发送请求的Ajax对象
    updater = new Ajax.PeriodicalUpdater(
                                'status',
                                'fileupload',
                                {asynchronous:true, frequency:1, method: 'get', parameters: 'c=status', onFailure: reportError});

    return true;
  }
  
  //出错时处理方法
  function reportError(request){
    $('submitButton').disabled = false;

    $('status').innerHTML = '<div class="error"><b>Error communicating with server. Please try again.</b></div>';
  }
  
  //上传完毕后,取消周期性获取进度状态，将最终的状态显示在客户端
  function killUpdate(message){
    $('submitButton').disabled = false;
    //停止刷新获取进度
    updater.stop();
    if(message != '')//如果有错误信息，则显示出来
    {
      $('status').innerHTML = '<div class="error"><b>Error processing results: ' + message + '</b></div>';
    }
    else//如果没有错误信息
    {
      //获取上传文件的完成状态，显示到客户端
      new Ajax.Updater('status',
                     'fileupload',
                     {asynchronous:true, method: 'get', parameters: 'c=status', onFailure: reportError});
    }
  }
  </script>

	<!-- add=========================== -->
	<style type="text/css">
<!--
body {
	background: #fff
}

.Menu {
	position: relative;
	width: 204px;
	height: 127px;
	z-index: 1;
	background: #FFF;
	border: 1px solid #000;
	margin-top: -100px;
	display: none;
}

.Menu2 {
	position: absolute;
	left: 0;
	top: 0;
	width: 100%;
	height: auto;
	overflow: hidden;
	z-index: 1;
}

.Menu2 ul {
	margin: 0;
	padding: 0
}

.Menu2 ul li {
	width: 100%;
	height: 25px;
	line-height: 25px;
	text-indent: 15px;
	border-bottom: 1px dashed #ccc;
	color: #666;
	cursor: pointer;
	change: expression(this.onmouseover =   function() {  
  this.style.background =   "#F2F5EF";
}

,
this.onmouseout  =function (){this .style.background="";
	
}

)
}
input {
	width: 200px
}

.form {
	width: 200px;
	height: auto;
}

.form div {
	position: relative;
	top: 0;
	left: 0;
	margin-bottom: 5px
}

#List1,#List2,#List3 {
	left: 0px;
	top: 93px;
}
-->
</style>
	<script type="text/javascript">
function showAndHide(obj,types){
var Layer=window.document.getElementById(obj);
switch(types){
case "show":
Layer.style.display="block";
break;
case "hide":
Layer.style.display="none";
break;
}
}
function getValue(obj,str){
var input=window.document.getElementById(obj);
input.value=str;
}
</script>
	<!-- add end=========================== -->


	<head>
		<title>修改视频信息</title>
		<link href="css/style.css" rel="stylesheet" type="text/css">
	</head>
	<body>
		<center>
			<h1>
				修改视频信息
			</h1>
			<div>
				<form method="post" action="servlet_editvideo" >
					<div>
						课程名称：
						<br>
						<input type="text" id="id_coursename" name="coursename"
							onfocus="showAndHide('List1','show');"
							onblur="showAndHide('List1','hide');" 
							value="${requestScope.data_course.name}"
							/>

						<div>
							课程图片(可选)：
							<br>
							<input type="file" name="coursepic" size="15"
								accept="image/jpeg,image/png">
						</div>


						<!--列表1-->
						<div class="Menu" id="List1">
							<div class="Menu2">
								<ul>
									<li
										onmousedown="getValue('id_coursename','java基础课程');showAndHide('List1','hide');">
										java基础课程
									</li>
									<li
										onmousedown="getValue('id_coursename','java高级开发技术课程');showAndHide('List1','hide');">
										java高级开发技术课程
									</li>
								</ul>
							</div>
						</div>
						<div>
							课程分类:
							<br>
							<select id="s1_text1_bold" name="coursetype">
								<option value="-1" selected="selected">
									请选择课程分类
								</option>
								<c:forEach var="list" items="${requestScope.data_coursetype}"
									varStatus="index">
									<option value="${list.id}">
										${list.name}
									</option>
								</c:forEach>
							</select>
						</div>
						课程简介:
						<br>

						<textarea name="coursecontent" cols="40" rows="4" >${requestScope.data_course.introduction}</textarea>
						<p>
							<div>
								章节名称：
								<br>
								<input type="text" id="id_sectionname" name="sectionname"
									onfocus="showAndHide('List2','show');"
									onblur="showAndHide('List2','hide');" 
									value="${requestScope.data_section.name}"
									/>
							</div>
							<!--列表2-->
							<div class="Menu" id="List2">
								<div class="Menu2">
									<ul>
										<li
											onmousedown="getValue('id_sectionname','${requestScope.data_section.name}');showAndHide('List2','hide');">
											${requestScope.data_section.name}
										</li>
										<li
											onmousedown="getValue('id_sectionname','第一章');showAndHide('List2','hide');">
											第一章
										</li>
										<li
											onmousedown="getValue('id_sectionname','第二章');showAndHide('List2','hide');">
											第二章
										</li>
									</ul>
								</div>
							</div>
							<div>
								章节分类:
								<br>
								<input type="text" id="id_sectiontype" name="sectiontype"
									onfocus="showAndHide('List3','show');"
									onblur="showAndHide('List3','hide');" 
									value="${requestScope.data_section.type}"/>
							</div>
							<!--列表3-->
							<div class="Menu" id="List3">
								<div class="Menu2">
									<ul>
										<li
											onmousedown="getValue('id_sectiontype','初学必备');showAndHide('List2','hide');">
											初学必备
										</li>
										<li
											onmousedown="getValue('id_sectiontype','学习进阶');showAndHide('List2','hide');">
											学习进阶
										</li>
									</ul>
								</div>
							</div>

							章节简介:
							<br>

							<textarea name="sectioncontent" cols="40" rows="4">${requestScope.data_section.introduction}</textarea>
							<p>
							</p>
							<div>
								视频名称：
								<br>
								<input type="text" id="id_videonname" name="videoname" value="${requestScope.data.name}"/>
							</div>
							<div>
								视频分类
								<br>
								<input type="text" name="videotype">
							</div>
							视频简介:
							<br>

							<textarea name="videocontent" cols="40" rows="4">${requestScope.data_section.introduction}</textarea>
							<p>
							</p>
							<div>
								视频标签：
								<br>
								<input type="text" id="id_tag" name="tag" />
								用;号隔开
							</div>
							<p></p>

							<input type="submit" value="提交">
							<input type="reset" value="重置">
						</p>
						</p>
						</p>
						</p>
				</form>

			</div>

			<center>
	</body>
</html>
